package com.guigu.www.cxk.controller;

import com.guigu.www.cxk.service.CXKBespeakSetMealService;
import com.guigu.www.pojo.BespeakSetMeal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//套餐表
@Controller
@RequestMapping("/BespeakSetMeal")
public class CXKBespeakSetMealController {
    @Autowired
    CXKBespeakSetMealService setMealService;

    @PostMapping
    @ResponseBody
    //根据体检类型查询所需的套餐
    public List<BespeakSetMeal> SelectBespeakSetMeal(int id) {
        return setMealService.ProBespeakSetMeal(id);
    }

    //根据套餐的id查询对应的套餐
    @PostMapping("/BespeakSet/{number}")
    @ResponseBody
    public BespeakSetMeal SelectByIdBespeak(@PathVariable int number){
        return setMealService.SelectByIdSetMeal(number);
    }

    /*根据会员id查询套餐信息*/
    @PostMapping("selectxiangqing/{sid}")
    @ResponseBody
    public List<BespeakSetMeal> selectxiangqing(@PathVariable int sid){
        return setMealService.SelectByIdBespeak(sid);
    }
}
